package org.tc.feign.product.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.tc.feign.service.FeignCommoditydetailsService;
import org.tc.product.entity.Commoditydetails;

import java.util.List;

//@RequestMapping("/Commoditydetails")
@CrossOrigin(origins = {"*"}, methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.OPTIONS}, allowCredentials = "true")
@RestController
public class CommoditydetailsController {

    @Autowired
    private FeignCommoditydetailsService feignCommoditydetailsService;

    @RequestMapping("/selectComDeByid")
    public List<Commoditydetails> selectComDeByid(@RequestParam(value="commodityid",required = false) Integer commodityid) {
        List<Commoditydetails> list = feignCommoditydetailsService.selectComDeByid(commodityid);
        return list;
    }

    @RequestMapping("/insertComDe")
    public int insertComDe(@RequestBody Commoditydetails commoditydetails) {
        return feignCommoditydetailsService.insertComDe(commoditydetails);
    }
}
